/**
 * 定义回文值为某个字符串改为回文的最少修改次数
 * 给定一个字符串，求所有子串的回文值之和
 * N在100，暴力枚举，O(N^3)
 */
#include <bits/stdc++.h>
using namespace std;

using llt = long long;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vi = vector<int>;
using vll = vector<llt>;

template<typename T>
void input(vector<T>&v, int n){
    v.assign(n + 1, {});
    for(int i=1;i<=n;++i) cin >> v[i];
}

template<typename T>
istream & operator >> (istream & is, vector<T> & v){
    for(auto & i : v) is >> i;
    return is;
}

llt const INF = 0x1F2F3F4F5F6F7F8F;
llt const NINF = -INF;
llt const MOD = 998244353LL;

string S;

int proc(const string & s){
    int n = s.length();
    int ans = 0;
    for(int i=0;i<n/2;++i){
        if(s[i] != s[n-1-i]) ans+=1;
    }
    return ans;
}

void work(){
    cin >> S;
    int n = S.length();
    int ans = 0;
    for(int i=0;i<n;++i){
        for(int j=i;j<n;++j){
            ans += proc(S.substr(i, j - i + 1));
        }
        
    }
    cout << ans << endl;
    return;
}


int main(){
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int nofkase = 1;
    // cin >> nofkase; 
    while(nofkase--) work();    
    return 0;
}
